RS422 to TTL Power Supply Converter Board
-
RM25.00
- Product Code: RS422 TO TTL
- Availability: In Stock
RS422 interface, two-way communication. B Y Z A ultra far transmission 1000 meters. The module has ESD 15KV protection. Onboard to increase the limit of 10 ohms current limiting current protection. Module with TVS diode. Anti lightning, peak voltage. The module has 120-ohm termination resistors, which can effectively reduce the interference of long-range communication. Have the power indicator light and the data receiving and sending indicator light. Panoramic view of state data. Module TTL side using 5V DC power supply TXD RXD compatible with 5V logic signal.
The module uses the original imported MAX490 chips, stability, and communication speed is far more than domestic products, up to 2.5MBPS.
Features:
Package Includes:
1 x RS422 to TTL Power Supply Converter Board
Add an LED to the Slave
This setup allows you to control the LED on pin 4 of the Slave Arduino based on commands received from the Master Arduino through RS-422 communication.
The connection between the two modules should be made with two pairs of twisted cables following the connections.
The Connection between the modules should be YA, ZB, AY, and BZ.
#include <SoftwareSerial.h> SoftwareSerial rs422(2, 3); // RX, TX #define btn_on 4 #define btn_off 5 // PROTOCOL DEFINITION #define TURN_ON "TURN_ON" #define TURN_OFF "TURN_OFF" void setup() { rs422.begin(9600); // Initialize software serial communication pinMode(btn_on, INPUT_PULLUP); pinMode(btn_off, INPUT_PULLUP); } void loop() { if (!digitalRead(btn_on)) { while (!digitalRead(btn_on)) { delay(20); // Debounce button press } // Send the protocol to turn on the LED rs422.print(TURN_ON); } else if (!digitalRead(btn_off)) { while (!digitalRead(btn_off)) { delay(20); // Debounce button press } // Send the protocol to turn off the LED rs422.print(TURN_OFF); } }
#include <SoftwareSerial.h> #include <string.h> SoftwareSerial rs422(2, 3); // RX, TX #define led 4 // PROTOCOL DEFINITION #define TURN_ON "TURN_ON" #define TURN_OFF "TURN_OFF" String protocol = ""; void setup() { rs422.begin(9600); pinMode(led, OUTPUT); Serial.begin(9600); } void loop() { if (rs422.available()) { protocol += char(rs422.read()); if (protocol == TURN_ON) { digitalWrite(led, HIGH); // Clear the protocol protocol = ""; } if (protocol == TURN_OFF) { digitalWrite(led, LOW); // Clear the protocol protocol = ""; } } }